from typing import List, Optional
from pydantic import BaseModel

class RoleBase(BaseModel):
    name: str
    description: Optional[str] = None

    class Config:
        from_attributes = True

class RoleCreate(RoleBase):
    pass

class Role(RoleBase):
    id: int
    permissions: List[str]

    class Config:
        from_attributes = True 